package me.xiaoyan.java.chapter15;

import java.util.Scanner;

public class StringBufferInsert {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		System.out.print("请输入数字:");
		String nums = input.next();
		StringBuffer sb = new StringBuffer(nums);//创建stringbuffer对象
		for(int i=sb.length()-3;i>0;i-=3)
		{
			sb.insert(i, ",");
		}
		
		
		System.out.println(sb);
	}

}
